package com.skyMailbox.sms.service;

import java.util.List;

public interface SensorSerialPort {

    public static final int FLOWCONTROL_NONE = 0;
    public static final int FLOWCONTROL_RTSCTS_IN = 1;
    public static final int FLOWCONTROL_RTSCTS_OUT = 2;
    public static final int FLOWCONTROL_XONXOFF_IN = 4;
    public static final int FLOWCONTROL_XONXOFF_OUT = 8;

    public List getAvailablePorts();

    public abstract void open(String portName) throws Exception;

    public abstract void close() throws Exception;

    public boolean isOpen();

    public abstract void setSerialPortParams(int baud, int data, int stop, int parity) throws Exception;

    public abstract int getBaudRate();

    public abstract int getDataBits();

    public abstract int getStopBits();

    public abstract int getParity();

    public abstract void setFlowControlMode(int flowcontrol) throws Exception;

    public abstract void disableReceiveTimeout();

    public abstract void enableReceiveTimeout(int time) throws Exception;

    public int readBytes(byte[] buf, int off, int len, long timeout) throws Exception;

    public void write(int value) throws Exception;

    public void write(byte[] buffer) throws Exception;

    public void write(byte[] buffer, int start, int length) throws Exception;
}
